import { browser } from 'webextension-polyfill-ts';

import { setvpnStore, gotoPage, storage, setConnectIcon } from '../utils';

export function sendMessage(data: any) {
    return new Promise((resolve, reject) => {
        browser.runtime.sendMessage(data).then(([data, state]) => {
            if (state) {
                resolve(data);
            } else {
                reject(data);
            }
        });
    });
}

export { setvpnStore, gotoPage, storage, setConnectIcon };
